package map.back.managerment.Controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import map.back.managerment.Service.myservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @program: managerment
 * @description: get viewer of sql
 * @author: Mr.Jiang
 * @create: 2020-12-01 23:03
 **/

@Api(value="Data Controller",tags={"数据库操作"})
@RestController
@RequestMapping("DB")
public class DataCtrl {

    @Autowired
    myservice serv;

    @PostMapping("test")
    public String test(){
        return "test";
    }

    @PostMapping("/myapitest")
    @ApiOperation("测试")
    public List<Map> myapitest(@RequestParam("id") int id){
        return serv.test(id);
    }

//    @RequestMapping("/myapitest1")
//    @ApiOperation("测试")
//    public List<Map> myapitest1(@RequestParam("id") int id){
//        return null;
//    }
}
